#ifndef _POWER_UP_H_
#define _POWER_UP_H_

#include <vector>

// A simple power-up effect tracker using a bit field to keep track of up to 32 special effects
// using an unsigned long as a 32-bit bitfield

class PowerUp
{
public:
	PowerUp();
	virtual ~PowerUp();

	bool						AddEffect(unsigned long EffectID, float Duration = -1.0f);
	bool						RemoveEffect(unsigned long EffectID);
	bool						CheckEffect(unsigned long EffectID);
	void						ClearEffects();

	bool						AddEffectByBit(unsigned char Bit, float Duration = -1.0f);
	bool						RemoveEffectByBit(unsigned char Bit);
	bool						CheckEffectByBit(unsigned char Bit);

	unsigned long				Tick(float dt);
	static unsigned long		Bit2ID(unsigned char Bit) { return (unsigned long)(1 << Bit); }

protected:
	struct EFFECT_DATA {
		unsigned long	EffectID;
		float			Duration;
	};
	std::vector<EFFECT_DATA>	m_Effects;

	unsigned long				m_CurrentEffects;
};

#endif // _POWER_UP_H_
